Operator CoFCamera

Operator Library: Hardware Platform

This operator represents the image data interface between a CXP over Fiber (CoF) camera running at 25 Gbit/s per fiber lane and VisualApplets. The operator can be used in a quad channel CoF configuration, i.e. 100 Gbit/s. The interface topology is selected by the FiberConnection parameter, which allows the operator to connect either to the QSFP28 port [0] or to the QSFP28 port [1]. The operator outputs raw image data no matter what format the camera delivers. You then need to convert this image data into the format sent by the camera. To convert the image data, use appropriate operators for aggregating and casting raw byte values to pixel values . Certain situations during operation may be communicated via the event system as described below. Additionally, the operator has various parameters signalling the status of the connection to the camera.

Available for Hardware Platform
imaFlex 2 Dual 100

Instantiation in VisualApplets

The operator provides image data on its output O. This output is always present. In addition to this standard output port, you can configure an optional MetaDataO output for the CXP header meta-data. The following pop-up dialog appears during operator instantiation:

Here, you can specify the optional meta data port. If you set the port availability to "0" (default), the port will not be present in the operator. If you set the port availability to 1, the meta data port is available in the operator interface.

Optional MetaDataO Port

MetaDataO is organized as a 10x1 kernel link, consisting of 10 x 24-bit components. The format for the output is shown in the following picture.

Each CXP frame provides a corresponding image header. The compressed image header consists of 10 different values. The values are between 8 to 24-bit. The operator provides these 10 values as a kernel value (10x1) padded, each component padded to 24-bit.

Image Header Field Kernel Index Bit Width [bit] Description
StreamId 0 8 ID of the CXP stream
Tag 1 16 Source image index. The index is incremented for each transferred image, wraps around to 0 at 0xFFFF. The same number shall be used by each stream containing data relating to the same image (in case of multi-tap streams).
XSize 2 24 The value represents the image width in pixels.
XOff 3 24 The value represents the horizontal offset in pixels of the image with respect to the left-hand pixel of the full device image.
YSize 4 24 The value represents the image height in pixels. This value is set to 0 for line scan images.
YOff 5 24 The value represents the vertical offset in pixels of the image with respect to the top line of the full device image. This value is set to 0 for line scan images.
DSizeL 6 24 The value represents the number of 32-bit data words per image line.
PixelF 7 16 The value represents the pixel format.
TapG 8 16 The value represents the tap geometry.
Flags 9 8 Image flags.

Device Resource Usage

The operator uses either 4 resources of Port[0] CoF Lane or 4 resources of Port[1] CoF Lane depending on the selection of the parameter FiberConnection. The resource represents a physical fiber lane in a QSFP28 connector, either on port [0] or on port [1]. The allocated lanes are then used exclusively for the CoF protocol. Different protocols with different operators (data forwarding) can also use the QSFP28 connectors. However, the protocol selection is for the entire QSFP28 port, i.e. for all 4 lanes inside it. You define the protocol in the FiberProtocol0 and FiberProtocol1 parameters of the AppletProperties operator. For the event system, a configurable resource of the type EventPort is used. Also, a read-only resource EventID is allocated, which is used by the runtime software for event channel identification and registration.

Port[n] stands for the QSFP28[n] connector. The resource index is the fiber lane within the selected connector.

[Note] Resources Are Read-Only

All resources except EventPort are read-only. Their values reflect the FiberConnection parameter value mapped to ports (connectors) and lanes (fiber connections within the connector).

[Important] Modifying Image Width and Image Height

Via the maximum image width and height properties of the output link you can adjust width and height to the camera-specific settings. However, the maximum image width on operator port O must be divisible by the parallelism of port O. Thus, make sure the maximum image width is divisible by the parallelism of port O!

Error Handling and Event System

When the operator detects that the received reconstructed frame is larger or smaller than what was promoted by the camera in the CXP image header, one of the corresponding error counter parameters is incremented:

  • If the received frame is smaller in its dimensions than what was specified in the image header, FrameCorruptedCount is incremented.

  • If the received frame is larger in its dimensions than what was specified in the image header, FrameOversizedCount is incremented.

For a set of very critical errors, the operator will forward asynchronous events to the host runtime software (Framegrabber SDK). Events can be caused by corrupted frames or CRC errors. The event name in the Framegrabber API is <hierarchical operator name>\CxpStreamStatus, e.g. Device1\Process0\Camera\CxpStreamStatus. The event payload is provided as four 16-bit data words. The event format is defined as follows:

  • word [0]:

    • Bits [0:15]: CXP image tag in which the event occurred.

  • word [1]:

    • Bits [0:7]: Are reserved and have no defined function. You can ignore their value.

    • Bits [8:15]: Stream ID in which the event occurred.

  • word [2]:

    • Bit [0]: CRC error occurred.

    • Bits [1:15]: Are reserved and have no defined function. You can ignore their value.

  • word [3]:

    • Bit [0]: Is reserved and has no defined function. You can ignore their value.

    • Bit [1]: Event loss occurred. This means that preceding events were lost. This happens when the runtime software does not react to events and the internal event queues overflow.

    • Bit [2:15]: Are reserved and have no defined function. You can ignore their value.

Each error event triggers an interruption in the runtime software. To reduce the number of interruptions, multiple events with the same frame tag may be merged. When events are merged, their error flags are combined.

If an event is lost, the event immediately preceding it will include information about the missing event. This preceding event can't be merged with any further events that share the same frame tag.

Events caused by CRC errors include a frame tag, but this tag may not always correspond to the exact frame where the CRC error occurred. In some cases, the tag might refer to the preceding or following frame.

This situation can occur when a camera sends a CXP packet that spans a transition between two or more frames. CRC computation is completed at the end of the packet, while the stream data is reconstructed on-the-fly. As a result, a CRC error might be detected after the preceding frame has already been sent by the operator.

Under normal conditions - where camera packets do not contain both the end of one frame and the beginning of the next - the frame tag reported during a CRC error will always be correct.

In other cases, if the complete frame stream data is smaller than the maximum packet size, there may be an overlap of one frame within a single packet. In such cases, the software application should treat the preceding frame (frame tag – 1) and the following frame (frame tag + 1) as potentially corrupted as well.

I/O Properties

Property Value
Operator Type M
Output Links O, image data output
MetaDataO, optional meta data output

Supported Link Format

Link Parameter Output Link O Output Link MetaDataO
Bit Width 8 24
Arithmetic unsigned unsigned
Parallelism 48 1
Kernel Columns 1 10
Kernel Rows 1 1
Img Protocol {VALT_IMAGE2D, VALT_LINE1D} (default: VALT_IMAGE2D) {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} (default: VALT_IMAGE2D)
Color Format VAF_GRAY VAF_GRAY
Color Flavor FL_NONE FL_NONE
Max. Img Width any (default: 1056) 1
Max. Img Height any (default: 1056) 1

Parameters

FiberConnection
Type Static Write parameter
Default port_0_lane_0_1_2_3
Range {port_0_lane_0_1_2_3, port_1_lane_0_1_2_3}

The parameter FiberConnection defines on which QSFP28 port the camera is connected and which lanes of that port the camera operator is using.

Currently, only camera configurations with 4 lanes are supported on port 0 and port 1. The selected QSFP28 port can be used only if the FiberProtocol parameter in the AppletProperties operator for that port is set to the CoF and not to DataForwarding.

If the FiberProtocol parameter is set to DataForwarding and the CoFCamera operator attempts to map to that fiber port, the Design Rule Check (DRC) will generate an error message. In this case, the FiberConnection parameter will be marked as conflicted (red), and hovering over it will display a quick-tip help message explaining the conflict.

Only one CoFCamera operator can use the same hardware QSFP28 port on the same lanes. Mappings between multiple operators must be unique across the entire design.

MaxPacketSize
Type Static Write parameter
Default _16384
Range {_16384, _8192}

The parameter MaxPacketSize defines the maximum stream packet size for the connected camera in bytes, as specified in the CXP standard. The camera will send stream packets equal to or smaller than this limit.

This parameter influences Block RAM FPGA resource usage: the smaller the value, the fewer Block RAM resources are used. Example (4 lanes): the value _16384 uses 64 Block RAM resources; the value _8192 uses 32 Block RAM resources.

InjectError
Type Dynamic Write parameter
Default PacketTagError
Range {PacketTagError, ImageTagError, CorrectedError, PacketBufferOverflow, CrcError, FrameCorrupted, FrameOversized, UnexpectedStartupData}

The parameter InjectError is used to inject errors for test purposes. An injected error increments the corresponding error count parameter.

Depending on the error type, an injection can also lead to a software interrupt event. See the descriptions of the related parameters for details on error semantics.

UsedConnections
Type Dynamic Read parameter
Default 4
Range [1 : 4]

This parameter isn't currently in use. It is included for future functionality.

PacketTagErrorCount
Type Dynamic Read parameter
Default 0
Range [0 : 4095]

The parameter PacketTagErrorCount counts the number of received packets that have a tag which is not compliant with the expected tag according to the CXP standard. This value counts situations when gaps are observed in the succeeding stream packet tag enumerations. It is a 12-bit counter:

  • Bits [10:0] represent the actual counter value.

  • Bit [11] stands for the counter overflow.

When the overflow bit is set, the counter value shall be treated as don't care, i.e., more than 2047 error situations have occurred.

ImageTagErrorCount
Type Dynamic Read parameter
Default 0
Range [0 : 4095]

This parameter counts how many mismatches occur between the image header tag, the expected tag according to the CXP standard, and the received tag. It is a 12-bit counter:

  • Bits [10:0] represent the actual count.

  • Bit [11] indicates overflow.

If the overflow bit is set, the counter value is invalid and should be ignored, meaning more than 2047 error situations have occurred.

CorrectedErrorCount
Type Dynamic Read parameter
Default 0
Range [0 : 4095]

This parameter shows the number of detected errors in the image header or line markers that have been successfully corrected. It is a 12-bit counter:

  • Bits [10:0] represent the actual count.

  • Bit [11] indicates overflow.

If the overflow bit is set, the counter value is invalid and should be ignored, meaning more than 2047 error situations have occurred.

PacketBufferOverflowCount
Type Dynamic Read parameter
Default 0
Range [0 : 4095]

This parameter monitors overflow situations in the channel bonding packet buffer. Overflow can occur only in configurations using more than one fiber lane due to the CXP protocol. It is a 12-bit counter:

  • Bits [10:0] represent the actual count.

  • Bit [11] indicates overflow.

If the overflow bit is set, the counter value is invalid and should be ignored, meaning more than 2047 error situations have occurred.

PacketBufferOverflowSource
Type Dynamic Read parameter
Default 0
Range [0x0 : 0xF]

This parameter implements a bit mask to query in which of the four CXP channels (i.e. fiber lanes) the packet buffer overflow occurred. Order:

  • LSB = lowest CXP channel number allocated by the operator.

  • MSB = highest CXP channel number allocated by the operator.

CameraScanMode
Type Dynamic Read parameter
Default area
Range {area, line}

The received image header indicates whether the stream is for area scan or line scan applications. This parameter shows the most recently received stream image header information.

UnexpectedStartupDataCount
Type Dynamic Read parameter
Default 0
Range [0 : 4095]

This parameter detects an error condition where the first data value after an operator reset is unexpected because no image header was received beforehand. It reports the number of unexpected bytes at the start of processing. It is a 12-bit counter:

  • Bits [10:0] represent the actual count.

  • Bit [11] indicates overflow.

If the overflow bit is set, the counter value is invalid and should be ignored, meaning more than 2047 error situations have occurred.

Unexpected startup data can occur due to an error in the implementation of the camera, frame grabber firmware, or incorrect software control of the discovery procedure. A hardware defect of the camera, fiber modules, or fiber cable could also cause such a situation.

FrameCorruptedCount
Type Dynamic Read parameter
Default 0
Range [0 : 4095]

This parameter counts corrupted frames during acquisition. Corrupted frames contain erroneous pixels that were sent to the VisualApplets pipeline. It is a 12-bit counter:

  • Bits [10:0] represent the actual count.

  • Bit [11] indicates overflow.

If the overflow bit is set, the counter value is invalid and should be ignored, meaning more than 2047 error situations have occurred.

FrameOversizedCount
Type Dynamic Read parameter
Default 0
Range [0 : 4095]

This parameter counts the number of oversized frames detected during acquisition. An oversized frame is one that contains more lines or pixels than specified in the image header. Such errors can result from transmission issues caused by hardware defects or from firmware bugs in the camera. It is a 12-bit counter:

  • Bits [10:0] represent the actual count.

  • Bit [11] indicates overflow.

If the overflow bit is set, the counter value is invalid and should be ignored, meaning more than 2047 error situations have occurred.

CrcErrorCount
Type Dynamic Read parameter
Default 0
Range [0 : 4095]

This parameter counts occurrences of CRC errors in CXP stream packets. It is a 12-bit counter:

  • Bits [10:0] represent the actual count.

  • Bit [11] indicates overflow.

If the overflow bit is set, the counter value is invalid and should be ignored, meaning more than 2047 error situations have occurred.